<template>
  <el-container class="home_container">
    <!--头部-->
    <el-header>
      <div>
        <!--        <img src="../assets/img/OAlogo.png" alt="OAsystem">-->
        <span>OAsystem</span>
      </div>
      <el-button type="info" @click="Signout">退出</el-button>
    </el-header>
    <!--页面主体-->
    <el-container>
      <!--侧边栏-->
      <el-aside :width="istoggle ? '64px' : '200px'">
        <div class="toggle-button" @click="toggleCollapse">|||</div>
        <el-menu :router="true" :collapse-transition="false" :collapse="istoggle" background-color="#333744"
                 text-color="#fff" active-text-color="#71C2E6">
          <el-menu-item index="/Talk">
            <i class="el-icon-chat-dot-round"></i>
            <span slot="title">消息</span>
          </el-menu-item>
          <el-menu-item index="/Luntan">
            <i class="el-icon-reading"></i>
            <span slot="title">论坛</span>
          </el-menu-item>
          <el-menu-item index="/Document">
            <i class="el-icon-document"></i>
            <span slot="title">文档管理</span>
          </el-menu-item>
          <el-menu-item index="Comment">
            <i class="el-icon-notebook-2"></i>
            <span slot="title">会议管理</span>
          </el-menu-item>
          <el-menu-item index="/Question">
            <i class="el-icon-s-order"></i>
            <span slot="title">问卷调查</span>
          </el-menu-item>
          <el-menu-item index="/Tags">
            <i class="el-icon-s-flag"></i>
            <span slot="title">代办标签</span>
          </el-menu-item>
          <el-menu-item index="/Project">
            <i class="el-icon-s-claim"></i>
            <span slot="title">任务编辑</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <!--右侧内同主题-->
      <el-main>
        <!--路由占位符-->
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  name: 'talk',
  data () {
    return {
      istoggle: false
    }
  },
  methods: {
    Signout () {
      window.sessionStorage.clear()
      this.$router.push('/')
    },
    toggleCollapse () {
      this.istoggle = !this.istoggle
    }
  }
}
</script>

<style lang="less" scoped>
  .el-header {
    background-color: #373D41;
    display: flex;
    justify-content: space-between;
    padding-left: 0;
    color: #fff;
    font-size: 30px;

    > div {
      display: flex;
      align-items: center;

      span {
        margin-left: 15px;
      }
    }
  }

  .el-aside {
    background-color: #333744;

    .el-menu {
      border-right: 0;
    }
  }

  .el-main {
    background-color: #EAEDF1;
  }

  .home_container {
    height: 100%;
  }

  .el-icon-menu {
    > span {
      font-size: 20px;
      color: #fff;
    }
  }

  .toggle-button {
    background-color: #4A5064;
    text-align: center;
    font-size: 10px;
    line-height: 30px;
    color: #fff;
    letter-spacing: 0.2em;
    cursor: pointer;
  }
</style>
